API Documentation
ImageBase.h
1 // ImageBase.h
3 //
5 
6 namespace nkImages
7 {
18  class ImageBase
19  {
20  public :
21 
25  ImageBase () ;
37  ImageBase (unsigned int width, unsigned int height, unsigned int depth, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize = 0, unsigned int rowByteSize = 0, unsigned int sliceByteSize = 0) ;
47  ImageBase (nkMemory::BufferCast<ImageDescriptor>&& images, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize, bool alphaPremultiplied = false, bool cubeMap = false) ;
53  ImageBase (const ImageBase& other) ;
59  ImageBase (ImageBase&& other) ;
63  virtual ~ImageBase () ;
64 
65  // Getters
70  unsigned int getWidth (unsigned int mip = 0) const ;
75  unsigned int getHeight (unsigned int mip = 0) const ;
80  unsigned int getDepthOrArraySize (unsigned int mip = 0) const ;
84  unsigned int getMipCount () const ;
92  unsigned int getPixelByteSize () const ;
97  unsigned int getRowByteSize (unsigned int mip = 0) const ;
102  unsigned int getSliceByteSize (unsigned int mip = 0) const ;
106  bool getAlphaPremultiplied () const ;
110  bool getCubeMap () const ;
111 
112  // Setters
118  void setFormat (PIXEL_FORMAT value) ;
124  void setPixelOrBlockByteSize (unsigned int value) ;
130  void setAlphaPremultiplied (bool value) ;
136  void setCubeMap (bool value) ;
137 
138  // Utils
151  nkMaths::Vector getPixel (unsigned int x, unsigned int y, unsigned int z = 0, unsigned int mip = 0) ;
160  Image decompress (const AlignmentDescriptor& alignmentDescriptor = AlignmentDescriptor()) ;
161 
162  // Data accessors
168  virtual unsigned char* getDataPtr () const = 0 ;
169 
170  // Operators
176  ImageBase& operator= (const ImageBase& other) ;
183  } ;
184 }
nkImages::ImageBase::getMipCount
unsigned int getMipCount() const
nkImages::ImageBase::getCubeMap
bool getCubeMap() const
nkImages::ImageBase::setCubeMap
void setCubeMap(bool value)
nkImages::ImageBase::ImageBase
ImageBase(nkMemory::BufferCast< ImageDescriptor > &&images, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize, bool alphaPremultiplied=false, bool cubeMap=false)
nkImages::ImageBase::ImageBase
ImageBase(ImageBase &&other)
nkImages::ImageBase::setAlphaPremultiplied
void setAlphaPremultiplied(bool value)
nkImages::ImageBase::getHeight
unsigned int getHeight(unsigned int mip=0) const
nkImages::ImageBase::operator=
ImageBase & operator=(const ImageBase &other)
nkImages::ImageBase::getDataPtr
virtual unsigned char * getDataPtr() const =0
nkImages::ImageBase::ImageBase
ImageBase()
nkImages::ImageBase::decompress
Image decompress(const AlignmentDescriptor &alignmentDescriptor=AlignmentDescriptor())
nkImages::ImageBase::getPixelByteSize
unsigned int getPixelByteSize() const
nkImages::ImageBase
Base for all image data classes.
Definition: ImageBase.h:19
nkImages::ImageBase::setFormat
void setFormat(PIXEL_FORMAT value)
nkImages::AlignmentDescriptor
Holds information about alignment constraints.
Definition: AlignmentDescriptor.h:12
nkImages
Encompasses all API of component NilkinsImages.
Definition: BmpEncoder.h:7
nkImages::ImageBase::setPixelOrBlockByteSize
void setPixelOrBlockByteSize(unsigned int value)
nkImages::ImageBase::getRowByteSize
unsigned int getRowByteSize(unsigned int mip=0) const
nkImages::ImageBase::ImageBase
ImageBase(const ImageBase &other)
nkImages::PIXEL_FORMAT
PIXEL_FORMAT
Lists formats for pixels.
Definition: PixelFormat.h:16
nkMemory::BufferCast
Holds a Buffer and make it easy to cast the binary data.
Definition: BufferCast.h:18
nkImages::ImageBase::getFormat
PIXEL_FORMAT getFormat() const
nkImages::ImageBase::getSliceByteSize
unsigned int getSliceByteSize(unsigned int mip=0) const
nkImages::ImageBase::ImageBase
ImageBase(unsigned int width, unsigned int height, unsigned int depth, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize=0, unsigned int rowByteSize=0, unsigned int sliceByteSize=0)
nkImages::ImageBase::getDepthOrArraySize
unsigned int getDepthOrArraySize(unsigned int mip=0) const
nkImages::ImageBase::getAlphaPremultiplied
bool getAlphaPremultiplied() const
nkMaths::Vector
A 4-component vector class, with floats.
Definition: Vector.h:12
nkImages::Image
Holds all information required for an image, with ownership over the data.
Definition: Image.h:14
nkImages::ImageBase::getPixel
nkMaths::Vector getPixel(unsigned int x, unsigned int y, unsigned int z=0, unsigned int mip=0)
nkImages::ImageBase::~ImageBase
virtual ~ImageBase()
nkImages::ImageBase::getWidth
unsigned int getWidth(unsigned int mip=0) const